<script setup lang="ts">
import {inject} from 'vue';
import type {InjectionKey} from "vue";

interface Options {
  location: string;
  reverse: Function;
}


// const {location, reverse} = Symbol() as InjectionKey<Options>
const {location, reverse} = inject('location') as Options;
// const {location, reverse} = inject<Options>('location');

</script>

<template>
  <div class="border rounded-3 p-3 m-3 shadow">
    <p>location: {{ location }}</p>
    <button @click="reverse()">反转</button>
  </div>
</template>

<style scoped>

</style>